# Maintainer: Brandon Boese <brandonboese@protonmail.com>
pkgname=lomiri-docviewer-app
pkgver=3.0.4
pkgrel=0
pkgdesc="A Document Viewer application capable of opening many common document file formats"
url="https://gitlab.com/ubports/development/apps/lomiri-docviewer-app"
# blocked by lomiri-ui-toolkit and libreofficekit
arch="all !armhf !ppc64le !s390x !riscv64"
license="GPL-3.0-only"
source="https://gitlab.com/ubports/development/apps/lomiri-docviewer-app/-/archive/v$pkgver/lomiri-docviewer-app-v$pkgver.tar.gz
	0001-non-click-mode-install-icon-and-splash.patch
	"
depends="
	lomiri-content-hub
	lomiri-thumbnailer
	lomiri-trust-store
	lomiri-ui-extras
	lomiri-ui-toolkit
	poppler-qt5
	qqc2-suru-style
	qt5-qtmultimedia
	"
makedepends="
	click-dev
	cmake
	cmake-extras
	libreofficekit
	poppler-qt5-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	"
checkdepends="
	py3-dbusmock
	py3-xdg
	xvfb-run
	"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check" # requires autopilot
subpackages="$pkgname-lang $pkgname-doc"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=OFF \
		-DCMAKE_BUILD_TYPE=None \
		-DCLICK_MODE=OFF \
		-DINSTALL_TESTS=Off
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b4ec929c432c28aaec3f011fd70a9e35708ff1e202a785624aa4bc4ffbb8664101362a1a9a4fa8d72529d4e455bd3c9b249659d266f6d2d2c69b353629fecb6f  lomiri-docviewer-app-v3.0.4.tar.gz
0f308ab1c1e6cc0cc6fc154936c9d103594249ab7c3fa1022f0d454c0c57b769f86b4fbff63950b47e43f28c43638fa9315772ee4cbe41aa7b75197cdf33f172  0001-non-click-mode-install-icon-and-splash.patch
"
